Conditions | 3 |
Total Lines | 17 |
Code Lines | 14 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | import {Inject} from '@nestjs/common'; |
||
17 | |||
18 | public async convert(holiday: Holiday): Promise<void> { |
||
19 | const type = |
||
20 | holiday.getLeaveType() === HolidayLeaveType.MEDICAL |
||
21 | ? EventType.MEDICAL_LEAVE |
||
22 | : EventType.HOLIDAY; |
||
23 | |||
24 | const dates = this.dateUtils.getWorkedDaysDuringAPeriod( |
||
25 | new Date(holiday.getStartDate()), |
||
26 | new Date(holiday.getEndDate()) |
||
27 | ); |
||
28 | |||
29 | for (const date of dates) { |
||
30 | //if () |
||
31 | |||
32 | this.eventRepository.save( |
||
33 | new Event(type, holiday.getUser(), 100, date.toISOString()) |
||
34 | ); |
||
38 |